*********************************************
************* Table 1, Column 1 *************
********************************************* 
clear all 
set more off
cd "/Users/yasenov/Dropbox/mariel_boatlift/jhr_version/jhr_figures"
global folder /Users/yasenov/Dropbox/mariel_boatlift/revision_version/revision_data/

use $folder/aux_march.dta

keep if age >= 19 & age <= 65
keep if wage != . & wage > 0
keep if low_skilled == 1
keep if hispan != 300
keep if hwtsupp > 0
keep if labforce == 2
drop if classwly == 10 | classwly == 13 | classwly == 14 

gen one = 1
gen mia = metarea == 5000

collapse (sum) one, by (year mia)
reshape wide one, i(year) j(mia)
replace year = year - 1
list

keep year one1
rename one1 col1

tempfile table1
saveold `table1'.dta, replace

*********************************************
************* Table 1, Column 2 *************
********************************************* 
use $folder/aux_may-org.dta, clear

keep if age >= 19 & age <= 65
keep if loguearnhre != .
keep if low_skilled == 1
drop if (ftpt79 == 0 & year <= 1988) | (ftpt89 ==1 & year > 1988) 
keep if classer == 1 | classer == 2
keep if ethnic != 5

gen one = 1
gen mia = smsarank == 26

collapse (sum) one, by (year mia)
reshape wide one, i(year) j(mia)
list

keep year one1
rename one1 col2

merge 1:1 year using `table1'.dta, nogenerate
saveold `table1'.dta, replace

******
******

use `table1'.dta, clear
keep if year >= 1973 & year <= 1991
order year col1 col2 
list

export excel using "jhr_tab1", replace
